<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.active{
				color: red;
			}
		</style>
	</head>
	<body>
		<div id="app">
			<!-- <h2 class="active">{{message}}</h2>
			<h2 :class="active">{{message}}</h2> -->
			<h2 :class="{active:isActive,line:isLine}">{{message}}</h2>
			<h2 :class="getClass()">{{message}}</h2>
			<button type="button" @click="btnClick">按钮</button>
		</div>
		<script src="../js/vue.js"></script>
		<script>
			const app=new Vue({
				el:'#app',
				data:{
					message:'你好',
					isActive:true,
					isLine:true
				},
				methods:{
					btnClick(){
						this.isActive=!this.isActive;
					},
					getClass(){
						return {active:this.isActive,line:this.isLine}
					}
				}
			})
		</script>
	</body>
</html>
